package top.ddandang.blog.model.vo;

import top.ddandang.blog.model.pojo.Tags;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 文章详细页面的文章数据的封装
 * </p>
 *
 * @author D
 * @version 1.0
 * @date 2020/7/12 15:07
 */
@Data
@Accessors(chain = true)
public class ArticleDetailVo {

    @ApiModelProperty(value = "文章ID")
    private Integer id;

    @ApiModelProperty(value = "文章标题")
    private String title;

    @ApiModelProperty(value = "文章内容md")
    private String contentMd;

    @ApiModelProperty(value = "文章内容html")
    private String contentHtml;

    @ApiModelProperty(value = "文章分类Id")
    private Integer categoryId;

    @ApiModelProperty(value = "文章分类")
    private String categories;

    @ApiModelProperty(value = "文章简要描述")
    private String description;

    @ApiModelProperty(value = "是否允许评论")
    private Boolean allowComment;

    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime gmtCreate;

    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @ApiModelProperty(value = "修改时间")
    private LocalDateTime gmtModified;

    @ApiModelProperty(value = "标签名")
    private List<Tags> tags;
}
